package com.slipper.mybatis;

public class TriggerHelper {
    protected static final ThreadLocal<Boolean> LOCAL_TRIGGER = new ThreadLocal<>();

    public static void closeTrigger() {
        LOCAL_TRIGGER.set(false);
    }

    public static void setTrigger(boolean trigger) {
        LOCAL_TRIGGER.set(trigger);
    }

    public static boolean isTrigger() {
        return LOCAL_TRIGGER.get() != null && LOCAL_TRIGGER.get();
    }
}
